package com.mc.code.service.Impl;

import com.mc.code.entity.CodeUsers;
import com.mc.code.mapper.LoginMapper;
import com.mc.code.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginImpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;

    @Override
    public List<CodeUsers> login(String username) {
      List<CodeUsers> codeUsers = loginMapper.login(username);
        return codeUsers;
    }

    @Override
    public int maxUserNo() {
       int id = loginMapper.maxId();
        return loginMapper.maxUserNo(id);
    }

    @Override
    public void registerUser(CodeUsers codeUsers) {
    loginMapper.registerUser(codeUsers);
    }

}
